[DllImport("setupapi.dll", SetLastError=true)]
static extern int CM_Locate_DevNodeA(ref int pdnDevInst, string pDeviceID, int ulFlags);
or
[DllImport("setupapi.dll", SetLastError=true)]
static extern int CM_Locate_DevNodeA(out IntPtr pdnDevInst, string pDeviceID, int ulFlags);
None.
Do you know one? Please contribute it!
None.
Please add some!
public const int CM_LOCATE_DEVNODE_NORMAL = 0x00000000;
public const int CR_SUCCESS = 0x00000000;
string deviceId = "USB/V0001/P0001/&6&12&3";
IntPtr pdnDevInst;
int apiResult = CM_Locate_DevNodeA(out pdnDevInst, deviceId, CM_LOCATE_DEVNODE_NORMAL);
if (apiResult != CR_SUCCESS)
{
// Handle error
}